﻿namespace BorgExt
{
    public abstract class RuntimeElement
    {
        public Runtime Runtime { get; private set; }
        protected internal object LockObject { get; private set; }

        protected TypeStore TypeStore
        {
            get { return Runtime.TypeStore; }
        }

        protected Composer Composer
        {
            get { return Runtime.Composer; }
        }

        protected InstanceStore InstanceStore
        {
            get { return Runtime.InstanceStore; }
        }

        protected DiscoveryCore DiscoveryCore
        {
            get { return Runtime.DiscoveryCore; }
        }

        protected Qualifier Qualifier
        {
            get { return Runtime.Qualifier; }
        }

        protected Notifier Notifier
        {
            get { return Runtime.Notifier; }
        }

        protected Logger Logger
        {
            get { return Runtime.Logger; }
        }

        internal void Init(Runtime runtime)
        {
            Runtime = runtime;
            LockObject = runtime.LockObject;
            Init();
        }

        protected virtual void Init()
        { }
    }
}

